#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.basic.security.imagecode;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 吴盼华
 * @date 2019/8/14 17:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImageCode {

	private String image;

    private String code;

    private LocalDateTime expireTime;

	ImageCode(String image, String code, int expireIn) {
		this.image = image;
		this.code = code;
		this.expireTime = LocalDateTime.now().plusSeconds(expireIn);
	}

	/**
	 * Description:
	 * <是否过期>
	 *
	 * @return java.lang.Boolean
	 * @author Zhoumaofa
	 * @date 15:20 2020/2/14
	 **/
	public Boolean isExpried() {
		return LocalDateTime.now().isAfter(expireTime);
	}

}
